Repository navigation
fix(models): close the GELU formula-rule gaps left after #2785 - #2804
Merged
Merged
Conversation
Five rule-breakers outside #2548's row list, all following the section-0b rule: the checkpoint config decides, an omitted key falls back to the Hugging Face config-class default, and mlxcel follows HF where mlx-lm or mlx-vlm departs. - GPT-BigCode now reads activation_function (absent or null means the GPTBigCodeConfig default gelu_pytorch_tanh), resolves it once at load onto MLP, and rejects non-GELU names in validate(); santacoder's declared tanh runs the compiled f32 kernel instead of the erf mlx-lm applies. - Idefics2 and Granite 4 Vision stop forcing use_fast_gelu (mlx-vlm's FastGELUMLP): the tower config decides, with Idefics2 resolving an omitted key to the Idefics2VisionConfig default via default_missing_hidden_act_to_siglip. - The shared VisionHiddenActivation maps every ACT2FN GELU name through GeluActivation::from_hf_name (gelu_new / gelu_fast now tanh) and rejects non-GELU names as load errors instead of silently running erf; Bunny's sparse-config fallback propagates the error rather than swallowing it. - A declared gelu_pytorch_tanh on the shared SigLIP MLP runs the compiled kernel like the omitted-key path (VisionMlpActivation::PytorchTanh removed, SiglipDefaultTanh folded in). - The dead C++ compiled_gelu is removed with its three FFI tests and both compile-audit entries; the XLA llava vision config accepts the same GELU name set. Docs rows T5, S6, S7 and the shared-config rule updated. Validated: cargo fmt, clippy --all-targets -D warnings (mlxcel, mlxcel-core, mlxcel-xla), the mlxcel-xla vision_config tests (10 passed), and a clean cargo check on the three packages. The GPU lib-test gate and VLM smoke runs were not run before this commit: the GB10 gpu-lock was held by another session; the orchestrator's contract gate covers them. No GPT-BigCode checkpoint exists on this host, so that smoke cannot run here. Closes #2794.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #2794: five GELU formula-rule gaps outside #2548's row list, following the section-0b rule (the checkpoint config decides; an omitted key falls back to the Hugging Face config-class default; mlxcel follows HF where mlx-lm or mlx-vlm departs).
What changed
activation_function(absent = theGPTBigCodeConfigdefaultgelu_pytorch_tanh), resolves it once at load ontoMLP, and rejects non-GELU names invalidate()use_fast_gelu = false; the tower config decides (Idefics2 resolves its omitted key to theIdefics2VisionConfigdefault viadefault_missing_hidden_act_to_siglip)VisionHiddenActivationmaps every ACT2FN GELU name throughGeluActivation::from_hf_name(gelu_new/gelu_fastnow tanh) and rejectsrelu/siluas load errors; Bunny's sparse-config fallback propagates instead of swallowinggelu_pytorch_tanhon the shared SigLIP MLP runs the compiled kernel like the omitted-key path (VisionMlpActivation::PytorchTanhremoved,SiglipDefaultTanhfolded in)compiled_geluremoved with its three FFI tests and both compile-audit entries; the XLA llava vision config accepts the same GELU name setdocs/gelu-call-sites.md: rows T5, S6, S7, a new S-cfg row, the shared-resolution paragraph, the inventory rows, and thecompiled_gelurow updated;GeluActivation"Used by" doc comment extendedTest plan
cargo fmt --all -- --checkpassescargo clippy --profile test-fast --features cuda -p mlxcel -p mlxcel-core -p mlxcel-xla --all-targets -- -D warningspasses (exit 0)cargo check(test-fast, cuda, the three packages) clean in 11m37scargo test -p mlxcel-xla vision_config: 10 passed, 0 failed--test-threads=1andMLX_ENABLE_TF32=0undergpu-lock(run after the push, when the lock freed): 111 passed, 0 failed, 1 ignored on CUDA (GB10)mlxcel generate --image+ onemlxcel-serverimage request each onmodels/idefics2-8b-4bit,models/granite-4.0-3b-vision-4bit,models/smolvlm-instruct-bf16,MLX_ENABLE_TF32=0, run after the push, ontests/fixtures/test_image.png): all six coherent. generate: idefics2 "A bright orange colored fabric with no patterns or text."; granite4 "The image provided is a solid block of a uniform color, specifically a bright orange or reddish-orange hue."; smolvlm "A solid orange background with no other objects, text, or scenery.". server: idefics2 "The image is a bright orange background with no other objects in the image."; granite4 "The image is a solid, uniform block of a bright orange color."; smolvlm "A solid orange background with no other objects, text, or elements present."models/mlx/gpt_bigcode-santacoderon a Mac hostCloses #2794